<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户收藏</title>
    <link rel="stylesheet" type="text/css" href="../static/user_css/reset.css">
    <link rel="stylesheet" type="text/css" href="../static/user_css/jquery.pagination.css">
    <link rel="stylesheet" type="text/css" href="../static/user_css/main.css">
    <script type="text/javascript" src="../static/user_js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../static/user_js/jquery.pagination.min.js"></script>
</head>
<body class="inframe_body">
<div class="my_collect">
    <h3>我的收藏</h3>
    <ul class="article_list">

        {# 遍历用户收藏的病毒数据 #}
        {% for virus in data.virus_list %}
            <li><a href="/virus/{{ virus.id }}">{{ virus.title }}</a><span>{{ virus.create_time }}</span></li>
        {% endfor %}
    </ul>


    <div id="pagination" class="page"></div>
    <script>
        $(function () {
            $("#pagination").pagination({
                currentPage: {{ data.currentPage }},
                totalPage: {{ data.totalPage }},
                callback: function (current) {
                    {#alert('ok! = ' + current);#}
                    {# 点击页数的时候,query会监听到id=pagination的事件,会自动调用,该回调函数 #}
                    {# 进入之后,使用window.location.href指定请求路径即可 #}
                    window.location.href = "/collection?p=" + current;
                }
            });
        });
    </script>

</div>
</body>
</html>